import React, { Component } from 'react';
import BaseComponent from '@/components/BaseComponent';
import { defDrawerWidth } from '@/defaultSettings';
import { Descriptions, Drawer } from 'antd';
import styles from './index.less';

class PreviewView extends BaseComponent {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    const { onClose, visible = false, record } = this.props;
    return (
      <Drawer
        title="预览"
        placement="right"
        width={defDrawerWidth}
        closable={true}
        onClose={e => {
          if (onClose) {
            onClose(e);
          }
        }}
        visible={visible}
      >
        {' '}
        <Descriptions bordered column={2}>
          <Descriptions.Item label="所属企业编号">{record.company_id}</Descriptions.Item>
          <Descriptions.Item label="废物名称">{record.waste_name}</Descriptions.Item>
          <Descriptions.Item label="废物类别">{record.waste_type}</Descriptions.Item>
          <Descriptions.Item label="固废代码">{record.waste_code}</Descriptions.Item>
          <Descriptions.Item label="危险特性">{record.waste_danger_type}</Descriptions.Item>
          <Descriptions.Item label="有害物质名称及含量">
            {record.waste_harmful_matter_content}
          </Descriptions.Item>
          <Descriptions.Item label="形态">{record.waste_form_type}</Descriptions.Item>
          <Descriptions.Item label="主要危险成分">
            {record.waste_hazardous_ingredients}
          </Descriptions.Item>
          <Descriptions.Item label="包装方式">{record.waste_packing}</Descriptions.Item>
          <Descriptions.Item label="应急设备">{record.waste_emergency_equipment}</Descriptions.Item>
          <Descriptions.Item label="禁忌措施">{record.waste_taboo_measures}</Descriptions.Item>
          <Descriptions.Item label="创建时间">{record.create_time}</Descriptions.Item>
          <Descriptions.Item label="更新时间">{record.update_time}</Descriptions.Item>
          <Descriptions.Item label="创建者">{record.create_by}</Descriptions.Item>
          <Descriptions.Item label="是否删除0未删除1已删除">{record.is_deleted}</Descriptions.Item>
        </Descriptions>{' '}
      </Drawer>
    );
  }
}

export default PreviewView;
